#!/usr/bin/python
"""Regular expression library"""
import re

def Find(pattern, textToExamine):
  match = re.search(pattern, textToExamine)
  matchall = re.findall(pattern, textToExamine)
  if match:
    print '---Single match (using search function)---'	
    print match.group()
    print '---All matches (using findall function----' 
    print matchall
  else: 
    print 'not found'
  
pattern = raw_input('Type a word from the text "O rato roeu a ropa do rei de Roma:" ')  
"""Please text different entries:
.(dot) macth any charcter
\w word character
\digit
\s whitespace \S non-whitespace
+ 1 or more
* 0 or more"""
  
Find(pattern, "O rato roeu a ropa do rei de Roma. Depois :123")





